﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
	<ResourceDictionary.MergedDictionaries>
		<ResourceDictionary Source="Main.xaml"/>
	</ResourceDictionary.MergedDictionaries>

	<SolidColorBrush x:Key="ExpanderBackgroundFill" Color="Transparent" />
	<SolidColorBrush x:Key="ExpanderShadowFill" Color="Transparent" />
	<SolidColorBrush x:Key="ExpanderMouseOverBrush" Color="Transparent" />

	<Style x:Key="ExpanderHeaderFocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Border>
						<Rectangle SnapsToDevicePixels="true" Margin="0" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" />
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border Padding="{TemplateBinding Padding}" HorizontalAlignment="Center">
						<Grid Margin="0,0,0,0" Height="6" SnapsToDevicePixels="False" Background="Transparent">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="59.375" />
								<ColumnDefinition Width="*" />
							</Grid.ColumnDefinitions>
							<Rectangle HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Fill="{DynamicResource ExpanderBackgroundFill}" Stroke="#FFA9A9A9" RadiusX="2" RadiusY="2" Grid.Column="0" x:Name="rectangle" />
							<Path HorizontalAlignment="Center" Margin="26,0.5,26,1.5" x:Name="arrow" VerticalAlignment="Center" SnapsToDevicePixels="false" Stroke="#666" StrokeThickness="2" Grid.Column="0" Data="M 1,1.5 L 4.5,5 L 8,1.5" Stretch="Fill" />
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsChecked" Value="true">
							<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5" />
							<Setter Property="Margin" TargetName="arrow" Value="26,0.8,26,1.2" />
						</Trigger>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="Stroke" TargetName="arrow" Value="#FF666666" />
							<Setter Property="Fill" TargetName="rectangle" Value="{DynamicResource ExpanderMouseOverBrush}" />
							<Setter Property="Stroke" TargetName="rectangle" Value="#FFA9A9A9" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border Padding="{TemplateBinding Padding}" VerticalAlignment="Center">
						<Grid SnapsToDevicePixels="False" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="19" />
								<ColumnDefinition Width="*" />
							</Grid.ColumnDefinitions>
							<Grid HorizontalAlignment="Left" Height="Auto" Width="60" VerticalAlignment="Top" 
								  ToolTip="{TemplateBinding Content}">
								<Grid.LayoutTransform>
									<TransformGroup>
										<TransformGroup.Children>
											<TransformCollection>
												<RotateTransform Angle="90" />
											</TransformCollection>
										</TransformGroup.Children>
									</TransformGroup>
								</Grid.LayoutTransform>
								<Rectangle HorizontalAlignment="Center" x:Name="rectangle" VerticalAlignment="Center" Width="50" Height="6" Fill="{DynamicResource ExpanderBackgroundFill}" Stroke="DarkGray" RadiusY="2" RadiusX="2" />
								<Path HorizontalAlignment="Stretch" x:Name="arrow" VerticalAlignment="Top" SnapsToDevicePixels="false" Stroke="#666" StrokeThickness="2" Data="M 1,1.5  L 4.5,5  L 8,1.5" Height="4.602" Stretch="Fill" Margin="26.622,0.695,26.623,0" />
								<!--<TextBlock  x:Name="TextBlock_Title" Visibility="Visible" Text="{TemplateBinding Content}" VerticalAlignment="Top" FontSize="8"/>-->
							</Grid>
							<!--<Grid Grid.Column="1" HorizontalAlignment="Left" Height="Auto" Width="60" VerticalAlignment="Top" 
								  ToolTip="{TemplateBinding Content}">
								<Grid.LayoutTransform>
									<TransformGroup>
										<TransformGroup.Children>
											<TransformCollection>
												<RotateTransform Angle="-90" />
											</TransformCollection>
										</TransformGroup.Children>
									</TransformGroup>
								</Grid.LayoutTransform>
								<TextBlock  x:Name="TextBlock_Title" Visibility="Visible" Text="{TemplateBinding Content}" VerticalAlignment="Top" FontSize="8"/>
							</Grid>-->
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsChecked" Value="true">
							<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5" />
							<!--<Setter Property="Visibility" Value="Collapsed" TargetName="TextBlock_Title" />-->
						</Trigger>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="Stroke" TargetName="rectangle" Value="#FFA9A9A9" />
							<Setter Property="Stroke" TargetName="arrow" Value="#FF666666" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border Padding="{TemplateBinding Padding}">
						<Grid SnapsToDevicePixels="False" Background="Transparent">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="19" />
								<ColumnDefinition Width="*" />
							</Grid.ColumnDefinitions>
							<Grid>
								<Grid.LayoutTransform>
									<TransformGroup>
										<TransformGroup.Children>
											<TransformCollection>
												<RotateTransform Angle="180" />
											</TransformCollection>
										</TransformGroup.Children>
									</TransformGroup>
								</Grid.LayoutTransform>
								<Ellipse x:Name="circle" 
									HorizontalAlignment="Center" VerticalAlignment="Center" 
									Width="19" Height="19" Fill="{DynamicResource ExpanderBackgroundFill}" Stroke="DarkGray" />
								<Ellipse Visibility="Hidden" HorizontalAlignment="Center" x:Name="shadow" VerticalAlignment="Center" Width="17" Height="17" Fill="{DynamicResource ExpanderShadowFill}" />
								<Path SnapsToDevicePixels="false" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" Stroke="#666" StrokeThickness="2" Data="M 1,1.5  L 4.5,5  L 8,1.5" />
							</Grid>
							<ContentPresenter SnapsToDevicePixels="True" HorizontalAlignment="Left" Margin="4,0,0,0" VerticalAlignment="Center" Grid.Column="1" RecognizesAccessKey="True" />
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsChecked" Value="true">
							<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5" />
						</Trigger>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="Stroke" TargetName="circle" Value="#666" />
							<Setter Property="Stroke" TargetName="arrow" Value="#222" />
							<Setter Property="Visibility" TargetName="shadow" Value="Visible" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border Padding="{TemplateBinding Padding}" VerticalAlignment="Center">
						<Grid SnapsToDevicePixels="False" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="19" />
								<ColumnDefinition Width="*" />
							</Grid.ColumnDefinitions>
							<Grid HorizontalAlignment="Left" Height="Auto" Width="60" VerticalAlignment="Top">
								<Grid.LayoutTransform>
									<TransformGroup>
										<TransformGroup.Children>
											<TransformCollection>
												<RotateTransform Angle="-90" />
											</TransformCollection>
										</TransformGroup.Children>
									</TransformGroup>
								</Grid.LayoutTransform>
								<Rectangle HorizontalAlignment="Center" x:Name="rectangle" VerticalAlignment="Center" Width="50" Height="6" Fill="{DynamicResource ExpanderBackgroundFill}" Stroke="DarkGray" RadiusY="2" RadiusX="2" />
								<Path HorizontalAlignment="Stretch" x:Name="arrow" VerticalAlignment="Top" SnapsToDevicePixels="false" Stroke="#666" StrokeThickness="2" Data="M 1,1.5  L 4.5,5  L 8,1.5" Height="4.602" Stretch="Fill" Margin="26.622,0.695,26.623,0" />
							</Grid>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsChecked" Value="true">
							<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5" />
						</Trigger>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="Stroke" TargetName="rectangle" Value="#FFA9A9A9" />
							<Setter Property="Stroke" TargetName="arrow" Value="#FF666666" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ExpanderStyle" TargetType="{x:Type Expander}">
		<Setter Property="Foreground" Value="{StaticResource LabelForeground}" />
		<Setter Property="Background" Value="Transparent" />
		<Setter Property="HorizontalContentAlignment" Value="Stretch" />
		<Setter Property="VerticalContentAlignment" Value="Stretch" />
		<Setter Property="BorderBrush" Value="Transparent" />
		<Setter Property="BorderThickness" Value="0,0,0,0" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Expander}">
					<Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="0,0,0,0">
						<DockPanel x:Name="dockPanel">
							<ToggleButton FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" 
										  FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" 
										  FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" 
										  HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
										  Padding="{TemplateBinding Padding}" 
										  VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" 
										  FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" 
										  Margin="1,1,1,1" MinHeight="0" MinWidth="0" x:Name="HeaderSite" 
										  Style="{StaticResource ExpanderDownHeaderStyle}" 
										  Content="{TemplateBinding Header}" 
										  ContentTemplate="{TemplateBinding HeaderTemplate}" 
										  ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" 
										  IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" 
										  DockPanel.Dock="Top" BorderThickness="0,0,0,0" Background="{x:Null}" 
										  BorderBrush="{x:Null}" />
							<!--<TextBlock  x:Name="TextBlock_Title" Visibility="Collapsed" Text="{TemplateBinding Header}" VerticalAlignment="Top" FontSize="8"/>-->
							<ContentPresenter x:Name="ExpandSite" 
											  Focusable="false" Visibility="Collapsed" 
											  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
											  Margin="{TemplateBinding Padding}" 											   
											  VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
											  DockPanel.Dock="Bottom" />
						</DockPanel>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsExpanded" Value="true">
							<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible" />
							<!--<Setter Property="Visibility" Value="Visible" TargetName="TextBlock_Title" />-->
						</Trigger>
						<Trigger Property="ExpandDirection" Value="Right">
							<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Right" />
							<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left" />
							<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderRightHeaderStyle}" />
							<Setter Property="Width" TargetName="HeaderSite" Value="6" />
							<Setter Property="HorizontalAlignment" TargetName="dockPanel" Value="Stretch" />
							<Setter Property="HorizontalAlignment" TargetName="HeaderSite" Value="Stretch" />
							<Setter Property="VerticalAlignment" TargetName="HeaderSite" Value="Stretch" />
						</Trigger>
						<Trigger Property="ExpandDirection" Value="Up">
							<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Top" />
							<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom" />
							<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderUpHeaderStyle}" />
						</Trigger>
						<Trigger Property="ExpandDirection" Value="Left">
							<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Left" />
							<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right" />
							<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderLeftHeaderStyle}" />
							<Setter Property="Width" TargetName="HeaderSite" Value="6" />
							<Setter Property="HorizontalAlignment" TargetName="dockPanel" Value="Stretch" />
							<Setter Property="HorizontalAlignment" TargetName="HeaderSite" Value="Stretch" />
							<Setter Property="VerticalAlignment" TargetName="HeaderSite" Value="Stretch" />
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<ControlTemplate x:Key="ExpanderToggleButton" TargetType="{x:Type ToggleButton}">
		<Grid>
			<Rectangle Margin="0,0,0,0" x:Name="Rectangle" Fill="Transparent" Stroke="{DynamicResource NormalBorderBrush}" />
			<Path HorizontalAlignment="Center" x:Name="Up_Arrow" VerticalAlignment="Center" Fill="{DynamicResource GlyphBrush}" Data="M 0 0 L 4 4 L 8 0 Z" />
			<Path Visibility="Collapsed" HorizontalAlignment="Center" x:Name="Down_Arrow" VerticalAlignment="Center" Fill="{DynamicResource GlyphBrush}" Data="M 0 4 L 4 0 L 8 4 Z" />
			<TextBlock x:Name="TextBlock_Title" Visibility="Collapsed" Text="kljslfkj"/>
		</Grid>
		<ControlTemplate.Triggers>
			<Trigger Property="IsMouseOver" Value="true">
				<Setter Property="Fill" Value="{DynamicResource ExpanderMouseOverBrush}" TargetName="Rectangle" />
			</Trigger>
			<Trigger Property="IsPressed" Value="true">
				<Setter Property="Fill" Value="{DynamicResource PressedBrush}" TargetName="Rectangle" />
			</Trigger>
			<Trigger Property="IsChecked" Value="true">
				<Setter Property="Visibility" Value="Visible" TargetName="Down_Arrow" />
				<Setter Property="Visibility" Value="Collapsed" TargetName="Up_Arrow" />
				<Setter Property="Visibility" Value="Visible" TargetName="TextBlock_Title" />
			</Trigger>
			<!--<Trigger Property="IsChecked" Value="false">
				<Setter Property="Visibility" Value="Collapsed" TargetName="TextBlock_Title" />
			</Trigger>-->
			<Trigger Property="IsEnabled" Value="False">
				<Setter Property="Fill" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Rectangle" />
				<Setter Property="Stroke" Value="{DynamicResource DisabledBorderBrush}" TargetName="Rectangle" />
				<Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}" />
				<Setter Property="Fill" Value="{DynamicResource DisabledForegroundBrush}" TargetName="Up_Arrow" />
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
</ResourceDictionary>